package com.company.cloud.user.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.user.modules.api.request.ValidateUserRequest;
import com.company.cloud.user.modules.api.response.ValidateUserResponse;
import org.springframework.stereotype.Component;

import com.company.cloud.user.modules.api.request.RegisterEmployeeRequest;
import com.company.cloud.user.modules.api.response.UserFull;
import com.company.cloud.user.modules.api.service.UserRegisterRemoteService;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;

@Log4j2
@Component
public class UserRegisterRemoteServiceFallbackFactory implements FallbackFactory<UserRegisterRemoteService>{

	@Override
	public UserRegisterRemoteService create(Throwable cause) {
		return new UserRegisterRemoteService() {
			@Override
			public BaseClientResult<UserFull> register(RegisterEmployeeRequest params) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<ValidateUserResponse> validateUserName(ValidateUserRequest params) {
				return BaseClientResult.callbackError();
			}
		};
	}

}
